home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / k3btocfilewriter.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  1.7 KB  |  63 lines

  1. /* 
  2.  *
  3.  * $Id: k3btocfilewriter.h 619556 2007-01-03 17:38:12Z trueg $
  4.  * Copyright (C) 2004 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16. #ifndef _K3B_TOC_FILE_WRITER_H_
  17. #define _K3B_TOC_FILE_WRITER_H_
  18.  
  19. #include <qtextstream.h>
  20. #include <qstringlist.h>
  21.  
  22. #include <k3btoc.h>
  23. #include <k3bcdtext.h>
  24.  
  25. namespace K3bDevice {
  26.   class TrackCdText;
  27. }
  28.  
  29. class K3bTocFileWriter
  30. {
  31.  public:
  32.   K3bTocFileWriter();
  33.  
  34.   bool save( QTextStream& );
  35.   bool save( const QString& filename );
  36.  
  37.   void setData( const K3bDevice::Toc& toc ) { m_toc = toc; }
  38.   void setCdText( const K3bDevice::CdText& text ) { m_cdText = text; }
  39.   void setFilenames( const QStringList& names ) { m_filenames = names; }
  40.   void setHideFirstTrack( bool b ) { m_hideFirstTrack = b; }
  41.  
  42.   /**
  43.    * The default is 1.
  44.    */
  45.   void setSession( int s ) { m_sessionToWrite = s; }
  46.  
  47.  private:
  48.   void writeHeader( QTextStream& t );
  49.   void writeGlobalCdText( QTextStream& t );
  50.   void writeTrackCdText( const K3bDevice::TrackCdText& track, QTextStream& t );
  51.   void writeTrack( unsigned int index, const K3b::Msf& offset, QTextStream& t );
  52.   void writeDataSource( unsigned int trackNumber, QTextStream& t );
  53.   bool readFromStdin() const;
  54.  
  55.   K3bDevice::Toc m_toc;
  56.   K3bDevice::CdText m_cdText;
  57.   QStringList m_filenames;
  58.   bool m_hideFirstTrack;
  59.   int m_sessionToWrite;
  60. };
  61.  
  62. #endif
  63.